﻿/*
	Copyright (C) 2008  Ajay Handa - jmdcms.com 
	This program is free software; 
	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	License for more details.
	Removing/Altering this copyright message is a violation of license terms.
*/

/*
	*** D O C U M E N T A T I O N ***
	---------------------------------
	Author: Ajay Handa
	Purpose: Site Information with its Parent Site and Alias Site	
	Last Changed On: Jan-26-2008
*/
IF EXISTS (SELECT * FROM sysobjects WHERE type = 'V' AND name = 'JmdSiteInfo')
BEGIN
	DROP  View dbo.JmdSiteInfo
END
GO

Create View dbo.JmdSiteInfo
As
 Select 
	SiteID = JmdSite.ID,
	SiteURL=JmdSite.siteURL, 
	ParentSiteID = ParentSite.ID,
    ParentSiteURL=ParentSite.SiteURL, 
	AliasSiteID = AliasSite.ID,
	AliasSiteURL=AliasSite.SiteURL 
from 
	JmdSite 
Left Outer Join 
	JmdSite ParentSite On JmdSite.ParentSiteID = ParentSite.ID
Left Outer Join
	JmdSite AliasSite On JmdSite.AliasSiteID = AliasSite.ID
